﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace LotteryAdmin.Converter
{
    public class ActiveConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string ReturnStr = value.ToString();
            switch (value.ToString())
            {
                case "0":
                    ReturnStr = "锁定";
                    break;
                case "1":
                    ReturnStr = "激活";
                    break;
                default:
                    ReturnStr = "";
                    break;
            }

            return ReturnStr;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //string strValue = value.ToString();
            //DateTime resultDateTime;
            //if (DateTime.TryParse(strValue, out resultDateTime))
            //{
            //    return resultDateTime;
            //}
            return value;
        }
    }
}
